StUU is a lightning fast drag-and-drop UUdecoder for the Mac.
StUU is pronounced “Stew U”
Special Features
• Fast: On a PowerMac 6100/60 with a good hard disk, StUU can decode over a megabyte per second.
• Drag-and-Drop: Simply drop files onto the StUU icon to have them decoded,
• Large Files: Any size files can be decoded, not limited by the amount of RAM your Mac has.
• Concatenated Files: If the source file contains multiple uuencoded files concatenated together, StUU will automatically recognise and extract all the component files.
• Robust: StUU correctly decodes files even if they have been divided into multiple parts separated by newsgroup headers, trailers, signatures, etc.
• Internet Config: StUU uses Internet Config to automatically assign the correct file type and creator code to each file it decodes, so decoded files appear with the correct icons, and if you double click on them the correct application will launche.
How to use StUU
The intended mode of use is:
1. Read your favourite binaries newsgroup with Nuntius
2. Instead of reading or extracting each item individually, just hit Cmd-A (Select All) and Cmd-S (Save) to save all the articles to disk as one big file. Current versions of Nuntius sort articles into a sensible order so it is almost always the case that if all the parts of a binary are present, they will be saved in the right order. It is possible that some parts will be missing, duplicated, or out of order, resulting in invalid output, but let’s face it, most of these newsgroups make up in quantity what they lack in quality, so it’s hardly worth wasting your time to repair every mal-formed posting by hand (although you can if you want to).
3. When Nuntius has finished saving the file, drag and drop it onto StUU, and in mere seconds (faster than duplicating a file in the Finder) the entire uuencoded contents will be extracted. The extracted files will be put in the same folder as the dropped file (as a rule of thumb, make sure you have free disk space equal to at least 75% of the size of the file you are decoding).
Restrictions
StUU is designed to do one job really quickly and simply: It decodes uuencoded files.
StUU only does decoding, not encoding.
If the file you want to decode is split into multiple parts, you must join all the parts together yourself before dropping the single joined file onto StUU. However, when joining the files together you do not need to manually remove mail headers and trailers from the individual parts — StUU can do that automatically while it is decoding the data.
StUU does not give you any control over where the output files are written — they are always written into the same folder as the source file.
StUU does not automatically delete the source file when it is finished.
StUU requires System 7.
StUU uses Internet Config. If you don’t have Internet Config installed, then StUU can still decode files, but the type and creator codes will be set to '????'.
Background
Why did I write StUU, when there are already lots of UU decoders for the Mac?
A little while ago, I had to decode a large uuencoded file. The file was 20 megabytes, and contained 112 component encoded files. I took a look on Sumex-Aim to see what uudecoding sofware was available for the Mac. I tried eight different uudecoders on it. Rather than go into great detail, I’ll just summarise the results:
• UUCat 1.1 failed with message "Error allocating memory for 'testfile.uu'. No space."
• UUParser 1.72 crashed with an address error.
• UnUU 2.0.1 failed with message "Out of memory! Try to give some more to UnUU (-108)"
• UUTool 2.4 decoded only the first file of the 112 and then stopped.
• MACUUCODE1.0.5 decoded only the first file of the 112 and then stopped.
• uuUndo 1.0b5 decoded only the first file of the 112 and then stopped.
• uucd 2.4.3 parsed the first 5 files of the 112 in 1 minute 16 seconds and then failed with message "The application's free memory seems to get low. You may have to give more memory to uucd from the Finder."
The only program that managed to finish decoding all the way to the end was Jeff Strobel’s UULite2.0.
UULite2.0 has three modes, with varying “intelligence”:
• UULite2.0 "No Frills Decoding" took 28 minutes.
• UULite2.0 "Smart Decoding" took 5 minutes 20 seconds.
• UULite2.0 "Super Smart Decoding" took 42 minutes.
Unfortunately none of UULite’s modes, not even the “Super Smart” one, correctly decoded all of the 112 files, and I thought $29 was too expensive for a small utility program that I would only use occasionally.
Since I didn’t intend to pay for it, I couldn’t continue to use UULite with a clean conscience, so morally, I had to write my own.
I searched the Web, found the spec for uuencoded files, found DropShell 2.0 by Leonard Rosenthol, Marshall Clow, and Stephan Somogyi, put them together, and after one morning of work I had finished writing my own simple uudecodeder.
It took 24 seconds to decode the 20 megabyte file. I added calls to Internet Config to assign the correct file types and creator codes for the decoded files, and it took 25 seconds. I made the I/O calls asynchronous, and it took 20 seconds. Then on the recommendation of Quinn, I tried it again with File Sharing turned off, and it took 16 seconds.
Well, there you have it. 20 megabytes decoded into 112 component files, complete with correct file types, in 16 seconds. For comparison, just duplicating the 20 megabyte file in the Finder took 17 seconds.
That makes StUU roughly 15 times faster that UULite’s “Smart” mode, and 120 times faster than “Super Smart” mode. Sorry Jeff.
Frequently Asked Questions
Why do you call it “Stupid” if it does better than UULite's “Super Smart” mode?
StUU is stupid in the sense that it’s not a very elegant Macintosh program. It has no user-interface to speak of, and no user preferences. You can’t specify the destination where you want the decoded files written, and it doesn’t multitask cooperatively with other Mac programs. It just hogs the CPU and runs until it is finished. On the other hand, StUU can launch, read a 50 megabyte file, finish decoding it, and quit in less time than it takes Microsoft Word 6.0 just to launch, and Microsoft Word doesn’t multitask cooperatively while it’s launching.
How does StUU detect garbage like headers and trailers in the input file, so that it can correctly ignore them and decode just the data portion?
The algorithm I use is as follows:
1. A "perfect" line is one which starts with a letter "M" and is 61 characters long. One or two extra characters are tolerated, so lines up to 63 characters long are also accepted as "perfect".
2. After the "begin" line, all perfect lines are read and decoded.
3. At the first imperfect line (i.e. one that is not "perfect"), StUU stops decoding and reads ahead in the file to see if this is the end of the encoded file, or just the end of this part of a split file.
3a. If StUU sees an "end", "begin" or "table" marker it deduces that this is the end of the file, so it finishes decoding the imperfect lines, even if they aren’t the full 61 characters long (the last one or two lines of a uuencoded file are normally shorter than the rest), closes the output file, and starts looking for the next "begin" marker.
3b. If StUU doesn’t see an "end", "begin" or "table" marker but sees two or more consecutive perfect lines it assumes that this block of imperfect lines is actually the signature, news header etc. marking the gap between two articles, so it ignores them completely and resumes decoding at the next perfect line.
4. The reason that StUU looks for two consecutive perfect lines to indicate the start of the next block is that it is possible for a news header to contain a line that by chance looks like a perfect uuencoded line because it happens to be exactly 61 characters long and starts with a letter "M". To reduce the chance of being tricked by this StUU requires two consecutive perfect lines before it believes that it is back in encoded data.
Because of this there are several ways that StUU might fail:
1. Validly UUEncoded files that don’t use the normal 61 character line length, but instead choose to block the data using lines of a different length. I have never seen one of these.
2. Validly UUEncoded files that use the normal 61 character line length but have three or more spurious extra characters or trailing spaces at the end of the line.
3. Validly UUEncoded files that have been split into parts where the poster’s signature or the news header contains two consecutive lines that look like valid uuencoded text
because they both start with the letter "M" and are 61 characters long, like these. In this case, as you see, it can be hard to distinguish between what is real uuencoded data, and what is just garbage interleaved with the file (as these lines were).
4. Validly UUEncoded files that have been split so that one of the parts, other than the last part, contains only a single 61 character uuencoded line.
I think scenarios 3 and 4 above are close to the point where a human being might have trouble deciding what was supposed to be data and what is not, so it’s not very surprising that software might have problems with it.
If you find a uuencoded file that you think is valid, but StUU won’t decode it correctly, please let me know, and I’ll try to fix it.
Licence
StUU is freeware. Providing that you acknowledge my authorship, you may distribute it any way you like, or do anything else with it, including producing derivative works from the source code. If my source code allows you to incorporate fast reliable uudecoding into your e-mailer, newsreader, or other program, then I will be happy to have made the lives of computer users a little easier.
Version History
1.0 Saturday 1st December 1995.
1.1 Tuesday 3rd April 1996. Significantly improved performance on Macs with RAM Doubler or Virtual Memory turned on.